package pl.bristleback.server.bristle.binding.resolvers;

import org.apache.log4j.Logger;

import java.math.BigInteger;

/**
 * Creates a new BigInteger instance using given parameter processed to String form.
 * <p/>
 * Created on: 2011-04-04 10:22:31 <br/>
 *
 * @author Wojciech Niemiec
 */
public class BigIntegerPropertyResolver implements PropertyValueResolver<BigInteger> {
  private static Logger log = Logger.getLogger(BigIntegerPropertyResolver.class.getName());

  public BigInteger extractValue(Object value) {
    try {
      return new BigInteger(value.toString());
    } catch (NumberFormatException e) {
      return null;
    }
  }
}
